home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
fortran
/
fv121s.zip
/
FAT4.DOC
< prev
next >
Wrap
Text File
|
1988-06-08
|
16KB
|
449 lines
MAY 1988 FAT-VIDEO 1.21 CLRSTR Page V-55
CLRSTR(STRING,LEN)
Clear a string by filling with blanks, the space character.
character*132 string1
character*1 string2(132)
integer*2 len
len=132
call clrstr(string1,len)
call clrstr(string2,len)
inputs: string,len
returns: string
Description:
This function fills each byte in the string with the space
character, up to the length specified.
REMNUL(STRING)
This routine remove the null character( char(0)) an the
'`' character, and replaces them with a space character.
character*20 string
call remnul(string)
Description:
This function is used to remove the null character in null
terminated strings, to allow Fortran functions to use the string
data.
MAY 1988 FAT-VIDEO 1.21 CGETS Page V-56
CGETS(STRING,MAXLEN,IERR)
Get a string from the keyboard, echo it to the screen, and return
its length and error status. The returned string is null terminated.
integer*2 maxlen,ierr
character string*40
maxlen=40
call cgets(string,maxlen,ierr)
if(ierr.eq.-1)return
Description:
This routine gets an ascii string from the user. It can be no
longer than maxlen, and the actual length typed is returned in
maxlen. Ierr is returned as zero if all went well. If the user
types the ESC key during string input the string is cleared and
the function returns ierr=-1 . This allows a clean cancel
of the read function. The string characters are echoed as they
are typed, but with normal video attributes. This function uses
the BIOS keyboard functions, and cannot be interrupted by the
Ctrl-C or Ctrl-Break keypresses. This function clears the string
prior to accepting any input.
INPUTS:
Maxlen = Maximum number of characters to accept from user.
OUTPUTS:
STRING = String typed in by the user.
Maxlen = Actual number of characters typed by the user.
Ierr = 0 safe return, -1 the ESC key was pressed.
Copyright (c) 1987,1988 Marc A Norton All Rights Reserved.
MAY 1988 FAT-VIDEO 1.21 CGETAS Page V-58
CGETAS(ATTR,STRING,MAXLEN,IERR)
Get a string from the keyboard, echo it to the screen using the
attribute specified, and return its length and error status. The
returned string is null terminated.
integer*2 attr,maxlen,ierr
character string*40
maxlen=40
call cgetas(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Description:
This routine gets an ascii string from the user. It can be no
longer than maxlen, and the actual length typed is returned in
maxlen. Ierr is returned as zero if all went well. If the user
types the ESC key during string input the string is cleared and
the function returns ierr=-1 . This allows a clean cancel
of the read function. The string characters are echoed as they
are typed, but with the video attribute given. This function uses
the BIOS keyboard functions, and cannot be interrupted by the
Ctrl-C or Ctrl-Break keypresses. This function clears the string
prior to accepting any input.
INPUTS:
ATTR = Attribute to use in echoing the string to the screen.
Maxlen = Maximum number of characters to accept from user.
OUTPUTS:
STRING = String typed in by the user.
Maxlen = Actual number of characters typed by the user.
Ierr = 0 safe return, -1 the ESC key was pressed.
Copyright (c) 1987,1988 Marc A Norton All Rights Reserved.
MAY 1988 FAT-VIDEO 1.21 CGETIS Page V-58
CGETIS(ATTR,STRING,MAXLEN,IERR)
Get a string from the keyboard, echo it to the screen, and return
its length and error status. This routine only accepts integers and
the - sign.
integer*2 attr,maxlen,ierr
character string*20
maxlen=20
call cgetis(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Description:
This routine gets an integer string from the user. It can be no
longer than maxlen, and the actual length typed is returned in
maxlen. Ierr is returned as zero if all went well. If the user
types the ESC key during string input the string is cleared and
the function returns ierr=-1 . This allows a clean cancel
of the read function. The string characters are echoed as they
are typed, but with normal video attributes. This function uses
the BIOS keyboard functions, and cannot be interrupted by the
Ctrl-C or Ctrl-Break keypresses. Only integers and the - sign
are accepted by this routine. This routine clears the string prior
to accepting any input.
The returned string is not null terminated and may be read into
an integer variable as follows:
real*8 R1
integer*2 I1
character*20 string
maxlen=20
call cput(' Enter a number: `')
call cgetis(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Read(unit=string,fmt='(g20.0)')R1
I1 = R1
INPUTS:
ATTR = Attribute to use in echoing the string to the screen.
Maxlen = Maximum number of characters to accept from user.
OUTPUTS:
STRING = String typed in by the user.
Maxlen = Actual number of characters typed by the user.
Ierr = 0 safe return, -1 the ESC key was pressed.
Copyright (c) 1987,1988 Marc A Norton All Rights Reserved.
MAY 1988 FAT-VIDEO 1.21 CGETRS Page V-59
CGETRS(ATTR,STRING,MAXLEN,IERR)
Get a string from the keyboard, echo it to the screen, and return
its length and error status. This routine only accepts integers and
the -,+ signs, and D,d,E,e characters. It is intended to accept
floating point numbers.
integer*2 attr,maxlen,ierr
character string*20
maxlen=20
call cgetrs(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Description:
This routine gets an floating point string from the user. It can
be no longer than maxlen, and the actual length typed is returned in
maxlen. Ierr is returned as zero if all went well. If the user
types the ESC key during string input the string is cleared and
the function returns ierr=-1. This allows a clean cancel
of the read function. The string characters are echoed as they
are typed, but with normal video attributes. This function uses
the BIOS keyboard functions, and cannot be interrupted by the
Ctrl-C or Ctrl-Break keypresses. Only integers and the -,+ signs
and D,d,E,e are accepted by this routine. This routine clears the
string prior to accepting any input.
The returned string is not null terminated and may be read into
an integer variable as follows:
real*8 R1
real*4 R2
character string*20
maxlen=20
call cput(' Enter a number: `')
call cgetrs(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Read(unit=string,fmt='(g20.0)')R1
maxlen=20
call cput(' Enter a number: `')
call cgetrs(attr,string,maxlen,ierr)
if(ierr.eq.-1)return
Read(unit=string,fmt='(g20.0)')R2
INPUTS:
ATTR = Attribute to use in echoing the string to the screen.
Maxle